﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Ryder_US_Website.BUS;
using Ryder_US_Website.Utils;

namespace Ryder_US_Website.Presentation.Admin
{
    public partial class CargoStatus_Insert : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["RUS_User"] == null)
            {
                Response.Redirect("Login.aspx");
            }

        }
        protected void clean()
        {
            txtTenTTDonHang.Text = "";
            txtMoTa.Text = "";
           
        }
        protected void btnHuy_Click(object sender, EventArgs e)
        {
            Response.Redirect("CargoStatus_List.aspx");
        }

        protected void btnLamLai_Click(object sender, EventArgs e)
        {
            clean();
        }

        protected void btnThem_Click(object sender, EventArgs e)
        {
            RUS_CargoStatus car = new RUS_CargoStatus();
            car.CargoStatus_name = txtTenTTDonHang.Text;
            car.CargoStatus_description = txtMoTa.Text;
            car.CargoStatus_trash = 0;
            if (txtTenTTDonHang.Text == "" || txtMoTa.Text == "")
                Response.Write(UtilHelpers.ShowMessage("Mời bạn nhập đầy đủ thông tin"));
            else
            {
                CargoStatusBUS.Insert(car);
                Response.Redirect("CargoStatus_List.aspx");
            }
            
        }
    }
}
